package com.qsl.ssyx.order.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qsl.ssyx.model.order.OrderItem;
import com.qsl.ssyx.order.mapper.OrderItemMapper;
import com.qsl.ssyx.order.service.OrderItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 订单项信息 服务实现类
 * </p>
 *
 * @author 青衫泪
 * @since 2023-09-08
 */
@Service
public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements OrderItemService {

    // 根据订单id集合查询订单商品
    @Override
    public List<OrderItem> getOrderItemByOrderInfoId(Long orderInfoId) {
        LambdaQueryWrapper<OrderItem> lqw = new LambdaQueryWrapper<>();
            lqw.eq(OrderItem::getOrderId, orderInfoId);
        List<OrderItem> orderItemList = baseMapper.selectList(lqw);
        return orderItemList;
    }
}
